import Vue from 'vue'
import Vuex from 'vuex'
import axios from 'axios'

Vue.use(Vuex)
export default new Vuex.Store({
    state: {
        count: 0,
        bankName:'建1行'
    },
    mutations: {
      increment (state) {
        state.count++
        },
        toWar3(state, param) { 
            console.warn(state, param)
            state.bankName=param
        }
    },
    getters: {
        doneCount: (state) => { 
            return state.bankName+'哈哈'
        }
    },
    actions: {
        bankToWar3(context, param) { 
          axios.get('/api/banner/acai_banners.php?pgid=2')
            .then((response) => {
                console.log(response);
                var _data = response.data.msg
                context.commit('toWar3',_data+param,)
            }) 
        }
    }
  })